{extend name='common/common' /}

{block name="style"}
<link href="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.css" rel="stylesheet">
{/block}

{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-10">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>查看客户信息</h5>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="commentForm" method="post" action="{:url('member/checkmember')}">
                        <input type="hidden" name="id" value="{$memberArr['id']}"/>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">姓名：</label>
                            <div class="input-group col-sm-7">
                                <input id="name" type="text" class="form-control" name="name" required="" aria-required="true" value="{$memberArr['name']}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">联系电话：</label>
                            <div class="input-group col-sm-7">
                                <input id="phone" type="text" class="form-control" name="phone" required="" aria-required="true" value="{$memberArr['name']}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">地址：</label>
                            <div class="input-group col-sm-7">
                                <input id="adress" class="form-control" name="adress" value="{$memberArr['adress']}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">QQ：</label>
                            <div class="input-group col-sm-7">
                                <input id="qq" class="form-control" name="qq" value="{$memberArr['qq']}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">微信：</label>
                            <div class="input-group col-sm-7">
                                <input id="weixin" class="form-control" name="weixin" value="{$memberArr['weixin']}" readonly>
                            </div>
                        </div>

						<!-- 学历  -->
						<div class="form-group">
							<label class="col-sm-3 control-label">学历：</label>
							<div class="input-group col-sm-7">
								<input id="education" class="form-control" name="{$memberArr['education']}" readonly>
							</div>
						</div>
						<!-- 意向专业 -->
						<div class="form-group">
							<label class="col-sm-3 control-label">意向专业：</label>
							<div class="input-group col-sm-7">
								<input id="intention" class="form-control" name="{$memberArr['intention']}" readonly>
							</div>
						</div>
						<!-- 工作行业 -->
						<div class="form-group">
							<label class="col-sm-3 control-label">工作行业：</label>
							<div class="input-group col-sm-7">
								<input id="industry" class="form-control" name="{$memberArr['industry']}" readonly>
							</div>
						</div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">等级：</label>
                            <div class="input-group col-sm-7">
                                <select name="grade" id="grade" class="form-control" readonly>
									<option value="<?=$memberArr['grade'];?>" selected><?=$memberArr['gradeN'];?></option>
									<?php foreach($gradeArr as $val): ?>
                                    	<option value="<?=$val['id'];?>" selected><?=$val['name'];?></option>
									<?php endforeach;?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">状态：</label>
                            <div class="input-group col-sm-7">
                                <select class="form-control" name="status" id="status" readonly>
                                    <option value="$memberArr['status']"><?= $memberArr['statusN'];?></option>
                                    <?php foreach($statusArr as  $val): ?>
                                    	<option value="<?= $val['id'];?>"><?=$val['name'];?></option>
                                	<?php endforeach;?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">录入咨询师：</label>
                            <div class="input-group col-sm-7">
                                <input id="first_relation" class="form-control" name="first_relation" value="{$memberArr['first_relation']}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">添加时间：</label>
                            <div class="input-group col-sm-7">
                                <input id="entry_time" class="form-control" name="entry_time" value="{$memberArr['entry_time']}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">备注：</label>
                            <div class="input-group col-sm-7">
                                <input id="remarks" class="form-control" name="remarks" value="{$memberArr['remarks']}" readonly>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-8">
                                <a href="javascript:;" onClick="javascript :history.back(-1);">
                                    <button type="button" class="btn btn-primary btn-sm" style="width: 20%;margin-left: 30%">
                                        返回
                                    </button>
                                </a>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}


{block name="script"}
<script src="__JS__/jquery.min.js?v=2.1.4"></script>
<script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
<script src="__JS__/content.min.js?v=1.0.0"></script>
<script src="__JS__/plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js"></script>
<script src="__JS__/plugins/validate/jquery.validate.min.js"></script>
<script src="__JS__/plugins/validate/messages_zh.min.js"></script>
<script src="__JS__/layui/layui.js"></script>
<script src="__JS__/jquery.form.js"></script>

<script type="text/javascript">

    var index = '';
    function showStart(){
        index = layer.load(0, {shade: false});
        return true;
    }

    function showSuccess(res){
        layer.ready(function(){
            layer.close(index);
            if(1 == res.code){
                layer.alert(res.msg, {title: '友情提示', icon: 1, closeBtn: 0}, function(){
                    window.location.href = res.data;
                });
            }else if(111 == res.code){
                window.location.reload();
            }else{
                layer.msg(res.msg, {anim: 6});
            }
        });
    }

    $(document).ready(function(){
        // 添加角色
        var options = {
            beforeSubmit:showStart,
            success:showSuccess
        };

        $('#commentForm').submit(function(){
            $(this).ajaxSubmit(options);
            return false;
        });

//        $('#adress').tagsinput('add', 'some tag');
//        $(".bootstrap-tagsinput").addClass('col-sm-12').find('input').addClass('form-control')
//                .attr('placeholder', '输入后按enter');
//        var editor = UE.getEditor('container');
    });

    // 表单验证
    $.validator.setDefaults({
        highlight: function(e) {
            $(e).closest(".form-group").removeClass("has-success").addClass("has-error")
        },
        success: function(e) {
            e.closest(".form-group").removeClass("has-error").addClass("has-success")
        },
        errorElement: "span",
        errorPlacement: function(e, r) {
            e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
        },
        errorClass: "help-block m-b-none",
        validClass: "help-block m-b-none"
    });
</script>
{/block}
